package com.nycreativity.elecreativity.entity.po

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableId
import com.nycreativity.elecreativity.entity.BaseEntity
import org.springframework.util.ObjectUtils

/**
 * <p>
 * 
 * </p>
 *
 * @author sxt && ttxxi
 * @since 2021-03-11
 */
class Address : BaseEntity() {

    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    var id: Long? = null
    /**
     * 用户id
     */
    var userId: Long? = null
    /**
     * 是否默认？0：否，1：是
     */
    var isDefault: Int? = null
    /**
     * 用户名
     */
    var name: String? = null
    /**
     * 称谓
     */
    var title: String? = null
    /**
     * 手机号码
     */
    var phoneNum: String? = null
    /**
     * 国家
     */
    var country: String? = null
    /**
     * 省份
     */
    var province: String? = null
    /**
     * 城市
     */
    var city: String? = null
    /**
     * 县区
     */
    var district: String? = null
    /**
     * 详细地址
     */
    var detailAddress: String? = null


    override fun toString(): String {
        return "Address{" +
        "id=" + id +
        ", userId=" + userId +
        ", isDefault=" + isDefault +
        ", name=" + name +
        ", title=" + title +
        ", phoneNum=" + phoneNum +
        ", country=" + country +
        ", province=" + province +
        ", city=" + city +
        ", district=" + district +
        ", detailAddress=" + detailAddress +
        ", ${super.toString()}}"
    }

    fun isEmpty(): Boolean{
        return ObjectUtils.isEmpty(id) && ObjectUtils.isEmpty(userId) && ObjectUtils.isEmpty(isDefault)
                && ObjectUtils.isEmpty(name) && ObjectUtils.isEmpty(title) && ObjectUtils.isEmpty(phoneNum)
                && ObjectUtils.isEmpty(country) && ObjectUtils.isEmpty(province) && ObjectUtils.isEmpty(city)
                && ObjectUtils.isEmpty(district) && ObjectUtils.isEmpty(detailAddress)
    }
}
